io_block: define MAX_IO_BLOCK_DEVICES as unsigned
authorYann Gautier <[email protected]>
Mon, 3 Dec 2018 12:38:06 +0000 (13:38 +0100)
committerYann Gautier <[email protected]>
Mon, 10 Dec 2018 17:09:49 +0000 (18:09 +0100)
This is used as a table index, and already compared with an unsigned int:
block_dev_count.

Signed-off-by: Yann Gautier <[email protected]>
drivers/io/io_block.c
plat/hisilicon/hikey/include/platform_def.h
plat/hisilicon/hikey960/include/platform_def.h
plat/hisilicon/poplar/include/platform_def.h
plat/imx/imx7/warp7/include/platform_def.h
plat/socionext/uniphier/include/platform_def.h

index 8226554d92eb9bbb6ab6d870228bc1fae1399a2d..ff13113afb45a5fdd37c5e9264a2fbfd1d1edb5f 100644 (file)
@@ -67,8 +67,10 @@ io_type_t device_type_block(void)
 static int find_first_block_state(const io_block_dev_spec_t *dev_spec,
                                  unsigned int *index_out)
 {
+       unsigned int index;
        int result = -ENOENT;
-       for (int index = 0; index < MAX_IO_BLOCK_DEVICES; ++index) {
+
+       for (index = 0U; index < MAX_IO_BLOCK_DEVICES; ++index) {
                /* dev_spec is used as identifier since it's unique */
                if (state_pool[index].dev_spec == dev_spec) {
                        result = 0;
index f2d358a7ba45313b24b817817160340fce9ecbd6..485eb380041c51a6b5066c95933a22a9a57e2596 100644 (file)
@@ -41,7 +41,7 @@
 #define MAX_IO_DEVICES                 3
 #define MAX_IO_HANDLES                 4
 /* eMMC RPMB and eMMC User Data */
-#define MAX_IO_BLOCK_DEVICES           2
+#define MAX_IO_BLOCK_DEVICES           U(2)
 
 /* GIC related constants (no GICR in GIC-400) */
 #define PLAT_ARM_GICD_BASE             0xF6801000
index 3717ff8afad47eacba8d556c749a1b2be6534f94..427a1e7596efe7bb5fa88350b83fd1962e96d9da 100644 (file)
@@ -38,7 +38,7 @@
 #define MAX_IO_DEVICES                 3
 #define MAX_IO_HANDLES                 4
 /* UFS RPMB and UFS User Data */
-#define MAX_IO_BLOCK_DEVICES           2
+#define MAX_IO_BLOCK_DEVICES           U(2)
 
 
 /*
index 6287a76aade17fac83f31a29f0b70af408ee6c0d..e39d94471a019b738dd75341f91a5b2b35e331af 100644 (file)
@@ -40,7 +40,7 @@
 /* IO framework user */
 #define MAX_IO_DEVICES                 (4)
 #define MAX_IO_HANDLES                 (4)
-#define MAX_IO_BLOCK_DEVICES           (2)
+#define MAX_IO_BLOCK_DEVICES           U(2)
 
 /* Memory size options */
 #define POPLAR_DRAM_SIZE_1G    0
index d0148f42230bae5bfbdfaa2d03fcc221a2f34830..4ee6fd37deb49fac52cb19fdec52093636848b09 100644 (file)
 #define MAX_XLAT_TABLES                        6
 #define MAX_IO_DEVICES                 2
 #define MAX_IO_HANDLES                 3
-#define MAX_IO_BLOCK_DEVICES           1
+#define MAX_IO_BLOCK_DEVICES           1U
 
 /* UART defines */
 #if PLAT_WARP7_UART == 1
index 3d71db20537cb78f6f8e7f0fe2c9da779ea5f7b1..6e9b98edb1ce169bbffb053ba2c27a4b735dfa31 100644 (file)
@@ -53,7 +53,7 @@
 
 #define MAX_IO_HANDLES                 2
 #define MAX_IO_DEVICES                 2
-#define MAX_IO_BLOCK_DEVICES           1
+#define MAX_IO_BLOCK_DEVICES           U(1)
 
 #define TSP_SEC_MEM_BASE               (BL32_BASE)
 #define TSP_SEC_MEM_SIZE               ((BL32_LIMIT) - (BL32_BASE))